]>
Commit | Line | Data |
---|---|---|
1 | import Foundation | |
2 | import Cocoa | |
3 | ||
4 | class BackgroundView: QSBezelBackgroundView { | |
5 | ||
6 | override func draw(_ rect: NSRect) { | |
7 | let boundsRect = bounds | |
8 | ||
9 | let roundRect = NSBezierPath() | |
10 | roundRect.appendRoundedRect(boundsRect, xRadius: 8.0, yRadius: 8.0) | |
11 | roundRect.addClip() | |
12 | ||
13 | let darkMode = effectiveAppearance.name == .darkAqua | |
14 | if (darkMode) { | |
15 | NSColor(red: 0.1, green: 0.1, blue: 0.1, alpha: 0.99).setFill() | |
16 | } else { | |
17 | NSColor(red: 1, green: 1, blue: 1, alpha: 0.99).setFill() | |
18 | } | |
19 | boundsRect.fill(using: .copy) | |
20 | ||
21 | super.draw(boundsRect) | |
22 | } | |
23 | } |